﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="<%=basePath%>">
			<script type="text/javascript" src="plugins/websocketInstantMsg/ext4/ext-all-debug.js"></script>
			<script type="text/javascript" src="static/js/jquery-1.7.2.js" />
			<script type="text/javascript" src="plugins/websocketInstantMsg/ext4/locale/ext-lang-zh_CN.js"></script>
			<link rel="stylesheet" href="plugins/websocketInstantMsg/ext4/resources/css/ext-all.css" />
</head>
<body class="no-skin">
<div id="form"></div>
<div id="default"></div>
</body>
<script type="text/javascript">
Ext.onReady(function(){
	Ext.QuickTips.init();
	var selModel = Ext.create('Ext.selection.CheckboxModel',{checkOnly:false});
	var columns = [ 
					{text:'ID',dataIndex:'ID',hidden:true},
	                 {text:'托单编号',dataIndex:'BILL_CODE'}, //sortable:true 可设置是否为该列进行排序  
	                 {text:'提单编号',dataIndex:'LADING_BILL_CODE'},  
	                 {text:'贸易类型',dataIndex:'TRADE_METHOD'}, 
	                 {text:'海船卸区 ',dataIndex:'SEA_UNLOAD'}, 
	                 {text:'江船承运人',dataIndex:'CARRIER'}, 
	                 
	                 {text:'船公司',dataIndex:'SHIP_COMPANY'}, 
	                 {text:'江船名',dataIndex:'BOAT_NAME'}, 
	                 
	                 {text:'江船航次',dataIndex:'BOAT_VOYAGE_NAME'}, 
	                 {text:'托运人',dataIndex:'SHIPPER_NAME'}, 
	                 {text:'货主',dataIndex:'SHIPPER_NAME'}, 
	                 {text:'江船起点港',dataIndex:'STARTING_PLACE'}, 
	                 {text:'江船终点港',dataIndex:'DESTINATION'}, 
// 	                 {text:'20',dataIndex:'ENABLE'}, 
// 	                 {text:'40',dataIndex:'ENABLE'}, 
// 	                 {text:'40H',dataIndex:'ENABLE'}, 
// 	                 {text:'45',dataIndex:'ENABLE'}, 
	                 {text:'中文货名',dataIndex:'CHINESE_NAME'},
	                 {text:'揽货人',dataIndex:'SALER_NAME'}, 
	                 {text:'操作员',dataIndex:'BILL_INPUTER'},
	                 
	                 {text:'海船靠区',dataIndex:'SHIP_REGION'},
	                 
	                 {text:'江船ETD',dataIndex:'SCHEDULED_SAILING_TIME'}, 
	                 {text:'江船ETA',dataIndex:'PLANNED_ARRIVAL_TIME'}, 
	                 
	                 {text:'海船名 ',dataIndex:'SHIP_NAME'}, 
	                 {text:'海船航次',dataIndex:'SHIP_VOYAGE_NAME'}, 
	                 {text:'海船ETD',dataIndex:'SHIP_ETD'},
	                 
	                 {text:'装箱方式',dataIndex:'ENCASEMENT_METHOD'}, 
	                 {text:'提箱/港装时间',dataIndex:'ESTIMATE_EXTRACT_BOX_TIME'}, 
	                 
	                 {text:'重箱进场时间',dataIndex:'WEIGHT_BOX_TIME'}, 
	                 {text:'报关资料是否到达',dataIndex:'IS_CUSTOM_INFO_ARRIVE'}, 
	                 
	                 {text:'件数',dataIndex:'GOODS_NUM'}, 
	                 
	                 {text:'包装类别',dataIndex:'PACK_TYPE'}, 
	                 
	                 {text:'毛重',dataIndex:'GOODS_GROSS_WEIGHT'}, 
	                 {text:'总体积',dataIndex:'VOLUME'}
	               ];
	
	  Ext.define('store', {
			extend : 'Ext.data.Model',
			fields :[  
				   {
	   		name:'ID'
	   	},  {
	   	    name: 'BILL_CODE'
	   	},{
	   	    name : 'LADING_BILL_CODE'
	   	},{
	   	    name : 'TRADE_METHOD'
	   	},{
	   	    name : 'SEA_UNLOAD'
	   	}
	   	,{
	   	    name : 'CARRIER'
	   	}
	   	,{
	   	    name : 'SHIP_COMPANY'
	   	}
	   	,{
	   	    name : 'BOAT_NAME'
	   	}
	   	,{
	   	    name : 'BOAT_VOYAGE_NAME'
	   	}
	   	,{
	   	    name : 'SHIPPER_NAME'
	   	}
	   	,{
	   	    name : 'SHIPPER_NAME'
	   	}
	   	,{
	   	    name : 'STARTING_PLACE'
	   	}
	   	,{
	   	    name : 'DESTINATION'
	   	}
	   	,{
	   	    name : 'CHINESE_NAME'
	   	}
	   	,{
	   	    name : 'SALER_NAME'
	   	}
	   	,{
	   	    name : 'BILL_INPUTER'
	   	}
	   	,{
	   	    name : 'SHIP_REGION'
	   	}
	   	,{
	   	    name : 'SCHEDULED_SAILING_TIME'
	   	}
	   	,{
	   	    name : 'PLANNED_ARRIVAL_TIME'
	   	}
	   	,{
	   	    name : 'SHIP_NAME'
	   	}
	   	,{
	   	    name : 'SHIP_VOYAGE_NAME'
	   	}
	   	
	   	,{
	   	    name : 'SHIP_ETD'
	   	}
	   	,{
	   	    name : 'ENCASEMENT_METHOD'
	   	},{
	   	    name : 'ESTIMATE_EXTRACT_BOX_TIME'
	   	},{
	   	    name : 'WEIGHT_BOX_TIME'
	   	},{
	   	    name : 'IS_CUSTOM_INFO_ARRIVE'
	   	},{
	   	    name : 'GOODS_NUM'
	   	},{
	   	    name : 'PACK_TYPE'
	   	},{
	   	    name : 'GOODS_GROSS_WEIGHT'
	   	},{
	   	    name : 'VOLUME'
	   	}
	   	
				]
		});
	  var bs2 = Ext.create('Ext.container.Container', {
			layout: 'column',
			items: [
				{id:"startDate1",xtype: 'textfield', labelWidth : 50,name: 'startDate1',padding: '10px', fieldLabel: '托单号'},
				{id:"startDate2",xtype: 'textfield', labelWidth : 50,name: 'startDate2',padding: '10px',fieldLabel: '提单号'},
				{id:"startDate3",xtype: 'textfield', labelWidth : 50,name: 'startDate3',  padding: '10px',fieldLabel: '业务员'},
				{id:"startDate4",xtype: 'textfield', labelWidth : 50,name: 'startDate4',  padding: '10px',fieldLabel: '托运人'},
				{layout : 'column',baseCls : 'my-panel-no-border',   padding: '10px', items: [
					{ style: {marginRight:'10px'}, xtype: "button",minWidth:70,icon:'../plugins/websocketInstantMsg/ext4/shared/icons/fam/add.png', text: "查询",handler: function(){
			      		 var BILL_CODE = Ext.getCmp('startDate1').getValue();
				      		var LADING_BILL_CODE = Ext.getCmp('startDate2').getValue();
				      		 var BILL_INPUTER = Ext.getCmp('startDate3').getValue();
					      		var SHIPPER_NAME = Ext.getCmp('startDate4').getValue();
						      		
					var store = Ext.getCmp('grid').getStore();
					store.on('beforeload', function(store,options) {  
				            var new_params = {  
				            		BILL_CODE : BILL_CODE, LADING_BILL_CODE:LADING_BILL_CODE,BILL_INPUTER:BILL_INPUTER,SHIPPER_NAME:SHIPPER_NAME
				            };  
					//这里apply一下实现新的proxy  
				            Ext.apply(store.proxy.extraParams,new_params);  
				        });  
					//对store重新载入  
				        store.load();  


							
				      	 } },
				],},
				
			]
		});
	  var selForm = Ext.create('Ext.form.Panel', {
// 			title:'查询',
			name: 'form',
			renderTo: "form",
			width:3000,
//			collapsed :true,
			height:60,
//			collapsible:true,
// 			bodyStyle: {
// 				padding: '5px',
// 				border: 1
// 			},
// 			fieldDefaults: {
// 				labelAlign: 'left'
// 			},
			items: [bs2]
		});
	
	 var store = Ext.create('Ext.data.Store', {
			model : 'store',
			pageSize:10,
//			pageSize : thePageSize,
			id:'store',
			proxy : {
				type : 'ajax',
				actionMethods : {
					read : 'POST'
				},//将提交方式改为post
				url : '<%=basePath%>findHomePageInfo',
				reader : {
					type : 'json',
					root : 'root',totalProperty:'total'
				}
			}
		});
	 store.load({ params:{start : 0,limit : 10}});
	 var paging = new Ext.PagingToolbar(
				{
					store : store,
					 pageSize:10,
					displayInfo : true,
					displayMsg : '<span style="color:blue;">第{0}条</span>至<span style="color:blue;">{1}条</span>，共<span style="color:blue;">{2}</span>条记录',
					emptyMsg : '无记录'
				});
	 
	 
	 var grid = new Ext.grid.GridPanel({
			//collapsible :true,
		    //split: true,
		    title:"托单信息",
		    width:3000,
		    height:600,
		    store:store,
		    forceFit:true,
		    columns:columns,
		    id:'grid',
		    selModel:selModel,
		    columnLines: true,
		    menuDisabled:true,
		     bbar : paging,
		     autoScroll: true,
// 		     tbar: [edit,deleteInfo],
		    viewConfig:{enableTextSelection:true,stripeRows: true},
		    renderTo:'default',
		});
});
</script>
</html>